package com.niit.bo;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;

/**
 * @author 王铭 20181620310021
 * #Date 2021/6/24 - 11:18
 */
@Data
@NoArgsConstructor
public class PageBean<T> {
    private int limitUp;
    private int limitDown;
    private int total;
    private int aPageNum = 15;
    private int totalPage;
    private int current = 1;
    private ArrayList<T> arrayList;

    public PageBean(int total, int aPageNum, int current) {
        this.total = total;
        this.aPageNum = aPageNum;
        this.current = current;

        totalPage = total / aPageNum + 1;
        limitUp = current * aPageNum;
        limitDown = (current - 1) * aPageNum;
    }
}
